//
//  TestProblem88.swift
//  LeetCodeTests
//
//  Created by 武侠 on 2023/6/12.
//  Copyright © 2023 zhulongiMac02. All rights reserved.
//

import XCTest
@testable import LeetCode

class TestProblem88: XCTestCase {
    
    var problem = Problem88()
    
    override func setUp() {
        super.setUp()
        // Put setup code here. This method is called before the invocation of each test method in the class.
    }
    
    override func tearDown() {
        // Put teardown code here. This method is called after the invocation of each test method in the class.
        super.tearDown()
    }
    
    // MARK: - 排序
    func testProblem88_Case1() throws {
        var nums1 = [1,2,3,0,0,0]
        var nums2 = [2,5,6]
        var m = 3
        var n = 3
        problem.merge(&nums1, m, nums2, n)
        assert(nums1 == [1,2,2,3,5,6])
    }
    
    func testProblem88_Case2() throws {
        var nums1 = [1]
        var nums2:[Int] = []
        var m = 1
        var n = 0
        problem.merge(&nums1, m, nums2, n)
        assert(nums1 == [1])
    }
    
    func testProblem88_Case3() throws {
        var nums1 = [0]
        var nums2:[Int] = [1]
        var m = 0
        var n = 1
        problem.merge(&nums1, m, nums2, n)
        assert(nums1 == [1])
    }
    
    func testProblem88_Case4() throws {
        var nums1 = [2,0]
        var nums2:[Int] = [1]
        var m = 1
        var n = 1
        problem.merge(&nums1, m, nums2, n)
        assert(nums1 == [1, 2])
    }
    
    func testProblem88_Case5() throws {
        var nums1 = [0,0,0,0,0]
        var nums2:[Int] = [1,2,3,4,5]
        var m = 0
        var n = 5
        problem.merge(&nums1, m, nums2, n)
        assert(nums1 == [1,2,3,4,5])
    }
}
